Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
first of all due to some technicalities we can no longer get_workbench - we shouldn't anyway (LoroDoc doesn't implement Clone so I can't just return a clone of the workbench itself)
it forced a long awaited fix: JS no longer duplicates the whole WASM memory
it should just hold the oplog (history) and evtree (LoroDoc) as well as a project and workbench index. that's it
so JS instead of calling Project::get_workbench now calls get_workbench_oplog and get_workbench_evtree where both require a project_index and workbench_index. both regular incremented numbers, nothing fancy
I also introduced set_workbench_evtree since we want a way for JS to update the evtree
so what changed?
lib.rs
Project struct - it can be removed completely - but calls static global functionsEvTree
struct. A thin wrapper aroundLoroDoc
LoroDoc
holds a list of step hashes. that's it. (this choice was made for us since Loro can't hold arbitrary types)LoroDoc
holds is always a sub-group of the actual history. the lorodoc can fork or whatever but the history is always linearproject::Project
struct:rebuild_workbench
. It accepts a workbench index and it:but there are quite a bit to get done in the UI:
wasmProject.*
$workbench
state but hold$oplog
,$evtree
,$project_index
,$workbench_index
and maybe$project
(for the name?) insteadoplog
andevtree
(onsend_message
update them both)evtree